#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDialog>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(ui->actionnew,&QAction::triggered,[=](){
        QDialog* dialog = new QDialog(this);
        dialog->resize(40,30);
        //dialog.exec();   //模态对话框
        dialog->setAttribute(Qt::WA_DeleteOnClose,true);
        dialog->show();  //非模态对话框
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

